/*
 * @author: sanbao
 * @Date: 2022-07-24 14:22:21
 */
// table
interface GoodsListInt {
    add_time: number
    cat_id: null
    cat_one_id: null
    cat_three_id: null
    cat_two_id: null
    goods_id: number
    goods_name: string
    goods_number: number
    goods_price: number
    goods_state: null
    goods_weight: number
    hot_mumber: number
    is_promote: boolean
    upd_time: number
}

// tablelist
type tablelistInt = {
    type?: string
    label: string
    prop?: string
    width?: string
    list?: [
        {
            type: string
            action: string
            name: string
        },
        {
            type: string
            action: string
            name: string
        }
    ]
}

// 分页
interface pagerInt {
    currentPage: number
    pageSize: number
    total: number
    pageSizes: [number, number, number]
}

// top 内容
// toplist
type toplistInt = {
    type: string,
    model?: string,
    label?: string,
    action?: string,
    list?: [{
        type: string
        name: string
        action: string
    }]
}
export class GoodsData {
    // table
    tableData: GoodsListInt[] = []
    //tablelist
    tablelist: tablelistInt[] = [
        {
            type: "index",
            label: "#",
        },
        {
            label: "商品名称",
            prop: "goods_name",
            width: '600px'
        },
        {
            label: "商品价格",
            prop: "goods_price",
        },
        {
            label: "商品重量",
            prop: "goods_weight",
        },
        {
            label: '创造时间',
            prop: 'upd_time'
        },
        {
            label: "操作",
            type: 'action',
            list: [{
                type: "primary",
                action: "edit",
                name: "编辑",
            },
            {
                type: "danger",
                action: "delete",
                name: "删除",
            }
            ]
        }
    ]
    // 分页
    pager: pagerInt = {
        currentPage: 1,
        pageSize: 5,
        total: 0,
        pageSizes: [5, 10, 15],
    }
    // top数据
    toplist: toplistInt[] = [
        {
            type: 'input',
            model: "seachVal",
            label: "请输入内容",
            action: "seach",
        },
        {
            type: "action",
            list: [
                {
                    type: 'primary',
                    name: "添加用户",
                    action: "add",
                }
            ]
        }
    ]

}